#ifndef __SLOTHTTPD_STAGE_SEND_HEADERS_HPP__
#define __SLOTHTTPD_STAGE_SEND_HEADERS_HPP__

#include <slothttpd/file.hpp>
#include <slothttpd/ref_counted.hpp>
#include <slothttpd/config/location/file_location.hpp>

#include <boost/function.hpp>
#include <boost/intrusive_ptr.hpp>

namespace slothttpd {
namespace stage {

class send_headers;
typedef boost::intrusive_ptr<send_headers> send_headers_static_ptr;

class send_headers :
        public ref_counted
{
public:
    send_headers(connection_ptr conn, const char *path, config::file_location &conf,
                 boost::function<void()> on_complete);
    
private:
    static void handle_send_headers(send_headers_static_ptr r, const boost::system::error_code &err);
    
public:
    file_ptr responce_file;
    
private:
    boost::function<void()> on_complete_;
};

}
}

#endif
